const routes=[
    {
        path:"/",
        name:"Home",
        component:()=>import("@/layouts/DefaultLayout.vue"),
        redirect:"/dashboard",
        children:[
            // 练习
            //二级路由
            {
                path:"/encapsulation/one/:draftNo",
                name:"购物车",
                component:()=>import("@/views/encapsulation/encapsulation.vue"),
                meta:{
                    keepAlive:true
                }
                
            },
            {
                path:"/encapsulation/two",
                name:"pinia练习",
                component:()=>import("@/views/encapsulation/two.vue"),
                
            },
            // 三级路由
            {
                path:"/encapsulation/three/one",
                name:"threeOne",
                component:()=>import("@/views/encapsulation/three/one.vue"),
            },
            {
                path:"/encapsulation/three/two",
                name:"threeTwo",
                component:()=>import("@/views/encapsulation/three/two.vue"),
            },
            {
                path:"/encapsulation/three/three",
                name:"threeThree",
                component:()=>import("@/views/encapsulation/three/three.vue"),
            },
            // 练习 四
            {
                path:"/encapsulation/four/one",
                name:"fourone",
                component:()=>import("@/views/encapsulation/four/one.vue"),
            },
            {
                path:"/encapsulation/four/two",
                name:"fourtwo",
                component:()=>import("@/views/encapsulation/four/two.vue"),
            },
            {
                path:"/encapsulation/four/three",
                name:"fourthree",
                component:()=>import("@/views/encapsulation/four/three.vue"),
            },
            {
                path:"/encapsulation/four/four",
                name:"fourfour",
                component:()=>import("@/views/encapsulation/four/four.vue"),
            },
            {
                path:"/encapsulation/four/five",
                name:"fourfive",
                component:()=>import("@/views/encapsulation/four/five.vue"),
            },
            {
                path:"/encapsulation/four/six",
                name:"foursix",
                component:()=>import("@/views/encapsulation/four/six.vue"),
            },
            //五
            {
                path:"/encapsulation/five/one",
                name:"fourone",
                component:()=>import("@/views/encapsulation/five/one.vue"),
                children:[
                    {
                      path:'/article',
                      component:()=>import("@/views/encapsulation/five/one/Article.vue"),
                    },
                    {
                      path:'/collect',
                      component:()=>import("@/views/encapsulation/five/one/Collect.vue"),
                    },
                    {
                      path:'/like',
                      component:()=>import("@/views/encapsulation/five/one/Like.vue"),
                    },
                    {
                      path:'/user',
                      component:()=>import("@/views/encapsulation/five/one/User.vue"),
                    }
                  ]
            },
            {
                path: '/detail',
                component:()=>import("@/views/encapsulation/five/one/ArticleDetail.vue")
              },
            {
                path:"/encapsulation/five/two",
                name:"fourtwo",
                component:()=>import("@/views/encapsulation/five/two.vue"),
            },
            {
                path:"/encapsulation/five/three",
                name:"fourthree",
                component:()=>import("@/views/encapsulation/five/three.vue"),
            },
            {
                path:"/encapsulation/five/four",
                name:"fourfour",
                component:()=>import("@/views/encapsulation/five/four.vue"),
            },
            {
                path:"/encapsulation/five/five",
                name:"fourfive",
                component:()=>import("@/views/encapsulation/five/five.vue"),
            },
            {
                path:"/encapsulation/five/six",
                name:"foursix",
                component:()=>import("@/views/encapsulation/five/six.vue"),
            },
            //菜单
            {
                path:"/dashboard",
                name:"dashboard",
                component:()=>import("@/views/dashboard/DashBoard.vue")
            },
            {
                path:"/chargingstation/monitor",
                name:"monitor",
                component:()=>import("@/views/chargingstation/Monitor.vue")
            },
            {
                path:"/chargingstation/revenue",
                name:"revenue",
                component:()=>import("@/views/chargingstation/Revenue.vue")
            },
            {
                path:"/chargingstation/fault",
                name:"fault",
                component:()=>import("@/views/chargingstation/Fault.vue")
            },
            {
                path:"/map",
                name:"map",
                component:()=>import("@/views/map/ElectronicMap.vue")
            },
            {
                path:"/operations/orders",
                name:"orders",
                component:()=>import("@/views/operations/Orders.vue"),
                meta:{
                    keepAlive:true
                }
            },
            {
                path:"/operations/detail",
                name:"detail",
                component:()=>import("@/views/operations/Detail.vue")
            },
            {
                path:"/operations/total",
                name:"total",
                component:()=>import("@/views/operations/Total.vue")
            },
            {
                path:"/alarm",
                name:"alarm",
                component:()=>import("@/views/alarm/Alarm.vue")
            },
            {
                path:"/equipment",
                name:"equipment",
                component:()=>import("@/views/equipment/Equipment.vue"),   
            },
            {
                path:"/document",
                name:"document",
                component:()=>import("@/views/document/Document.vue"),
                meta:{
                    needAuth:["admin","manager"]
                }
            },
            {
                path:"/system",
                name:"system",
                component:()=>import("@/views/system/System.vue"),
                meta:{
                    needAuth:["admin"]
                }
            },
            {
                path:"/personal",
                name:"personal",
                component:()=>import("@/views/personal/Personal.vue")
            },
        ]
    },
    {
        path:"/login",
        name:"Login",
        component:()=>import("@/views/Login.vue")
    },
    {
        path:"/:pathMatch(.*)*",
        name:"NotFound",
        component:()=>import("@/views/NotFound.vue")
    }
]

export default routes